<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@ page import="com.homework.service.HomeWorkService"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="com.homework.entity.Homewokmaster"%>
<%@ page import="com.homework.entity.Homeworkdetail"%>
<%@ page import="com.homework.entity.User"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.util.Date"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>作业管理系统</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Documentation and examples for Bootstrap’s powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.">
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
<meta name="generator" content="Jekyll v3.7.0">

<title>作业管理系统</title>

<!-- Bootstrap core CSS -->

<style class="anchorjs"></style><link href="./Navbar · Bootstrap_files/bootstrap.min.css" rel="stylesheet" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">


<!-- Documentation extras -->

<link href="./Navbar · Bootstrap_files/docsearch.min.css" rel="stylesheet">

<link href="./Navbar · Bootstrap_files/docs.min.css" rel="stylesheet">

<!-- Favicons -->
<link rel="apple-touch-icon" href="https://v4.bootcss.com/assets/img/favicons/apple-touch-icon.png" sizes="180x180">
<link rel="icon" href="https://v4.bootcss.com/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
<link rel="icon" href="https://v4.bootcss.com/assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png">
<link rel="manifest" href="https://v4.bootcss.com/assets/img/favicons/manifest.json">
<link rel="mask-icon" href="https://v4.bootcss.com/assets/img/favicons/safari-pinned-tab.svg" color="#563d7c">
<link rel="icon" href="https://v4.bootcss.com/favicon.ico">
<meta name="msapplication-config" content="/assets/img/favicons/browserconfig.xml">
<meta name="theme-color" content="#563d7c">


<!-- Twitter -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@getbootstrap">
<meta name="twitter:creator" content="@getbootstrap">
<meta name="twitter:title" content="Navbar">
<meta name="twitter:description" content="Documentation and examples for Bootstrap’s powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.">
<meta name="twitter:image" content="https://v4.bootcss.com/assets/brand/bootstrap-social-logo.png">

<!-- Facebook -->
<meta property="og:url" content="https://v4.bootcss.com/docs/4.0/components/navbar/">
<meta property="og:title" content="Navbar">
<meta property="og:description" content="Documentation and examples for Bootstrap’s powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.">
<meta property="og:type" content="website">
<meta property="og:image" content="http://v4.bootcss.com/assets/brand/bootstrap-social.png">
<meta property="og:image:secure_url" content="https://v4.bootcss.com/assets/brand/bootstrap-social.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
</head>
<body>
<%
  String username=(String)session.getAttribute("uname");
  User loginuser=(User)session.getAttribute("loginuser");
  if(username==null){
	  response.sendRedirect("login.html");
  }
%>
    <a id="skippy" class="sr-only sr-only-focusable" href="https://v4.bootcss.com/docs/4.0/components/navbar/#content">
      <div class="container">
        <span class="skiplink-text">Skip to main content</span>
      </div>
    </a>

    <header class="navbar navbar-expand navbar-dark flex-column flex-md-row bd-navbar">
  <a class="navbar-brand mr-0 mr-md-2" href="https://v4.bootcss.com/" aria-label="Bootstrap"><svg class="d-block" width="36" height="36" viewBox="0 0 612 612" xmlns="http://www.w3.org/2000/svg" focusable="false"><title>Bootstrap</title><path fill="currentColor" d="M510 8a94.3 94.3 0 0 1 94 94v408a94.3 94.3 0 0 1-94 94H102a94.3 94.3 0 0 1-94-94V102a94.3 94.3 0 0 1 94-94h408m0-8H102C45.9 0 0 45.9 0 102v408c0 56.1 45.9 102 102 102h408c56.1 0 102-45.9 102-102V102C612 45.9 566.1 0 510 0z"></path><path fill="currentColor" d="M196.77 471.5V154.43h124.15c54.27 0 91 31.64 91 79.1 0 33-24.17 63.72-54.71 69.21v1.76c43.07 5.49 70.75 35.82 70.75 78 0 55.81-40 89-107.45 89zm39.55-180.4h63.28c46.8 0 72.29-18.68 72.29-53 0-31.42-21.53-48.78-60-48.78h-75.57zm78.22 145.46c47.68 0 72.73-19.34 72.73-56s-25.93-55.37-76.46-55.37h-74.49v111.4z"></path></svg>
</a>

  <div class="navbar-nav-scroll">
    <ul class="navbar-nav bd-navbar-nav flex-row">
      <li class="nav-item">
        <a class="nav-link " href="https://v4.bootcss.com/" onclick="ga(&#39;send&#39;, &#39;event&#39;, &#39;Navbar&#39;, &#39;Community links&#39;, &#39;Bootstrap&#39;);">首页</a>
      </li>
      <li class="nav-item">
        <a class="nav-link active" href="https://v4.bootcss.com/docs/4.0/getting-started/introduction/" onclick="ga(&#39;send&#39;, &#39;event&#39;, &#39;Navbar&#39;, &#39;Community links&#39;, &#39;Docs&#39;);">积分排行榜</a>
      </li>
      <li class="nav-item">
        <a class="nav-link " href="https://v4.bootcss.com/docs/4.0/examples/" onclick="ga(&#39;send&#39;, &#39;event&#39;, &#39;Navbar&#39;, &#39;Community links&#39;, &#39;Examples&#39;);">实例</a>
      </li>
      <!-- <li class="nav-item">
        <a class="nav-link" href="https://themes.getbootstrap.com" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Themes');" target="_blank" rel="noopener">Themes</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="https://jobs.getbootstrap.com" onclick="ga('send', 'event', 'Navbar', 'Community links', 'Jobs');" target="_blank" rel="noopener">Jobs</a>
      </li> -->
      <li class="nav-item">
        <a class="nav-link" href="http://www.youzhan.org/" onclick="ga(&#39;send&#39;, &#39;event&#39;, &#39;Navbar&#39;, &#39;Community links&#39;, &#39;Expo&#39;);" target="_blank" rel="noopener">优站精选</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="https://blog.getbootstrap.com/" onclick="ga(&#39;send&#39;, &#39;event&#39;, &#39;Navbar&#39;, &#39;Community links&#39;, &#39;Blog&#39;);" target="_blank" rel="noopener">Blog</a>
      </li>
    </ul>
  </div>

  <ul class="navbar-nav flex-row ml-md-auto d-none d-md-flex">

    <li class="nav-item">
    <p class="navbar-brand">欢迎 <%=username %></p>
    </li>
  </ul>

  <a class="btn btn-bd-download d-none d-lg-inline-block mb-3 mb-md-0 ml-md-3" href="login.html">退出</a>
</header>


    <div class="container-fluid">
      <div class="row flex-xl-nowrap">
      
       <!-- 左边导航开始 -->
       	<jsp:include page="leftside.jsp"></jsp:include>
 		<!-- 左边导航结束 -->
        

        <main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 bd-content" role="main">
		          <h1 class="bd-title" id="content">今日竞赛</h1>
		          <p class="bd-lead">竞赛是每个人单独完成作业</p>
		          <%  HomeWorkService hs=new HomeWorkService();
		          String type="竞赛";
		          SimpleDateFormat sformat=new SimpleDateFormat("yyyy-MM-dd");
		          
		          Date today=new Date();
		          
		          ArrayList<Homewokmaster> hks=hs.getHomewokmasterByDateAndType(today.getTime(), type);
		         
		          for(int i=0;i<hks.size();i++){
		          %>
				          <!--  一条作业主表的记录 开始 -->
				          <h2 id="how-it-works">
				        	 <%=hks.get(i).getTitle() %>
				         </h2>
						<p>作业要求:</p>
						<ul>
						<!--  详情表的一条记录 开始 -->
						  <li><%=hks.get(i).getContent() %></li>
						<!--  详情表的一条记录 结束 -->
						
						</ul>
						
						
						 <form action="FormFileUploadServlet" method="post" enctype="multipart/form-data">
						    <input type="file" id="myFile" name="filename2">
						  	<input type="hidden" name="uid" value="<%=loginuser.getId()%>"/>
						  	<input type="hidden" name="hid" value="<%=hks.get(i).getId()%>"/>
						    <div class="mt-3">
						      <button type="submit" class="btn btn-primary">上传作业</button>
						    </div>
						  </form>
				  
				  
						  <!--  一条作业主表的记录 end -->
				 <%  } %>
				
				
				<br>
				
				<br>
				<p>竞赛作业，需要在中午12点前提交</p>
		</main>
        
        
        
      </div>
    </div>

    <script src="./Navbar · Bootstrap_files/jquery.slim.min.js.下载" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="/assets/js/vendor/jquery-slim.min.js"><\/script>')</script>

<script src="./Navbar · Bootstrap_files/popper.min.js.下载" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script><script src="./Navbar · Bootstrap_files/bootstrap.min.js.下载" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script><script src="./Navbar · Bootstrap_files/docsearch.min.js.下载"></script><script src="./Navbar · Bootstrap_files/docs.min.js.下载"></script>

<script type="text/javascript">
  
  $(document).ready(function(){
	  // 在这里写你的代码...
	  $("#nava1").css("color","red");
		  
	  });
  </script>

</body>
</html>